package com.cloudbroker.bcs.platform.ltb.bizapi.constants.status;

public enum UpvoteStatus {

    NOT_UPVOTE("0", "未点赞"),
    ALREADY_UPVOTE("1", "已点赞")

    ;
    
    private final String val;
    
    private final String description;
    
    private String toString;
    
    private UpvoteStatus(String val, String description) {
        this.val = val;
        this.description = description;
    }
    
    public String getVal() {
        return val;
    }
    
    public String getDescription() {
        return description;
    }
    
    public static String getDescription(String realVal) {
        for (UpvoteStatus s : UpvoteStatus.values()) {
            if (s.getVal() == realVal) {
                return s.getDescription();
            }
        }
        return String.valueOf(realVal);
    }
    
    @Override
    public String toString() {
        if (null == toString) {
            toString = new StringBuilder().append("UpvoteStatus[").append(val).append(':').append(description)
                    .append(']').toString();
        }
        return toString;
    }
    
}
